package com.pace.ribbon.event;

import java.util.*;

/**
 * 异步处理一些任务
 * eg
 */
public class OrderCreateEventPublisher {

    public void afterCreateOrder() {

        // 下单
        OrderCreateEvent orderCreateEvent = new OrderCreateEvent(UUID.randomUUID().toString());

        // ....
        // 下单成功
        System.out.println("下单成功之后，异步做一些简单处理");


        SpringContextHolder.getApplicationContext().publishEvent(orderCreateEvent);

        System.out.println("异步之后！");
    }

}


